package com.liao.liaowenlong.service;

import android.app.IntentService;
import android.content.Intent;
import android.os.SystemClock;
import android.util.Log;


public class MyIntentService extends IntentService {
    private static final String TAG = "MyIntentService";

    public MyIntentService() {
        super("MyIntentService");
    }


    @Override
    protected void onHandleIntent(Intent intent) {
        fun1(intent);
        fun2(intent);
    }

    private void fun1(Intent intent) {
        String data = intent.getStringExtra("data1");
        if (data != null && data.length() > 0) {
            for (int i = 10; i > 0; i--) {
                Log.d(TAG, "fun1: " + data + "======" + i);
                SystemClock.sleep(1000);
            }
        }
    }

    private void fun2(Intent intent) {
        String data = intent.getStringExtra("data2");
        if (data != null && data.length() > 0) {
            for (int i = 10; i > 0; i--) {
                Log.d(TAG, "fun2: " + data + "======" + i);
                SystemClock.sleep(1000);
            }
        }
    }

}
